import request from '/@/utils/request'

// 获取系统基本信息
export function getSystemInfo() {
  return request({
    url: '/admin/monitor/getSystemInfo',
    method: 'get'
  })
}

// 获取主板信息
export function getMotherboardInfo() {
  return request({
    url: '/admin/monitor/getMotherboardInfo',
    method: 'get'
  })
}

// 获取CPU信息
export function getCpuInfo() {
  return request({
    url: '/admin/monitor/getCpuInfo',
    method: 'get'
  })
}

// 获取内存信息
export function getMemoryInfo() {
  return request({
    url: '/admin/monitor/getMemoryInfo',
    method: 'get'
  })
}

// 获取磁盘信息
export function getDiskInfo() {
  return request({
    url: '/admin/monitor/getDiskInfo',
    method: 'get'
  })
}

// 获取显卡信息
export function getGpuInfo() {
  return request({
    url: '/admin/monitor/getGpuInfo',
    method: 'get'
  })
}

// 服务信息接口
export interface ServiceInfo {
  name: string
  port: number
  version: string
  pid: number
  memory: string
  cpu: string
}

// 服务监控响应接口
export interface ServiceResponse {
  services: ServiceInfo[]
}

/**
 * 获取服务监控信息
 */
export function getServiceInfo() {
  return request.get<ServiceResponse>('/admin/monitor/getServiceInfo')
}